//
// Created on 4/3/2024.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef HARMONY_CLIPPATHVIEWCOMPONENTINSTANCE_H
#define HARMONY_CLIPPATHVIEWCOMPONENTINSTANCE_H

#include "RNOH/CppComponentInstance.h"
#include "ClipPathViewStackNode.h"
#include "Props.h"
#include "ShadowNodes.h"

namespace rnoh {
    class ClipPathViewComponentInstance : public CppComponentInstance<facebook::react::RNCClipPathViewShadowNode>{
    private:
        ClipPathViewStackNode m_stackNode;
        std::string d;
        float opacity = 1.0f;
        bool opacityStatus = false;
        std::string mask = "/0";
        std::string oldMask = "/0";
        int fillColor = 0x000000;
        bool fillColorStatus = false;
        float fillOpacity = 1.0f;
        bool fillOpacityStatus = false;
        std::string fillRule = "/0";
        bool fillRuleStatus = false;
        int strokeColor;
        bool strokeColorStatus;
        float strokeOpacity;
        bool strokeOpacityStatus;
        float strokeWidth;
        bool strokeWidthStatus;
        std::string strokeCap;
        std::string strokeJoin;
        float strokeMiter;
        bool strokeMiterStatus;
        float strokeStart;
        bool strokeStartStatus;
        float strokeEnd;
        bool strokeEndStatus;
        int shadowColor;
        bool shadowColorStatus;
        float shadowOpacity ;
        bool shadowOpacityStatus;
        float shadowRadius;
        bool shadowRadiusStatus;
        float shadowOffsetX;
        float shadowOffsetY;
        bool shadowOffsetIsPercent;
        bool shadowOffsetStatus;
    
        float translationX = 0.f;
        float translationY = 0.f;
        bool translationIsPercent = false;
        float rotation;
        float rotationOx;
        float rotationOy;
        bool rotationIsPercent;
        float scale = 1.f;
        float scaleX = 1.f;
        float scaleY = 1.f;
        float scaleOrigin = 0.f;
        float scaleOriginX = 0.f;
        float scaleOriginY = 0.f;
        bool scaleIsPercent = false;
        int bgColor{0x00000000};
        std::string align;
        float viewBox[4];
    public:
        ClipPathViewComponentInstance(Context context);
        void insertChild(ComponentInstance::Shared childComponentInstance, std::size_t index) ;
        ClipPathViewStackNode &getLocalRootArkUINode() override;
        void onPropsChanged(SharedConcreteProps const &props) override;
        void getNapiProps(facebook::react::Props::Shared props);
    };
} // namespace rnoh

#endif // HARMONY_CLIPPATHVIEWCOMPONENTINSTANCE_H
